<!--
 * @Author: wangyu
 * @Date: 2024-12-26 12:18:43
 * @LastEditTime: 2024-12-26 21:33:26
 * @LastEditors: wangyu
 * @Description: 租赁情况
 * @FilePath: \dzsq-smartpark-platform\src\views\assetsManager\components\leaseDetailed.vue
-->
<template>
  <comHeaer title="园区内部租赁情况" @click="togo"></comHeaer>
  <div class="content">
    <span style="color: #65b8f8">年度：</span>
    <el-select v-model="value" placeholder="请选择" style="width: 120px">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
    <div class="content-imgs">
      <img src="@/assets/imgs/image_01.png" />
      <img src="@/assets/imgs/image_01.png" />
    </div>
    <div class="content-count">
      <div v-for="item in counts" :key="item.name" class="content-count-item">
        <div>{{ item.name }}</div>
        <div class="content-count-value">
          <span>{{ item.value }}</span
          >家
        </div>
      </div>
    </div>
    <div class="content-progress">
      <selfProgress :data="data[0]" />
      <selfProgress :data="data[1]" type="default" />
      <selfProgress :data="data[2]" type="default" />
      <selfProgress :data="data[3]" type="default" />
      <selfProgress :data="data[4]" />
    </div>
  </div>
</template>

<script setup>
import comHeaer from "../../components/comHeader/index.vue";
import selfProgress from "./progress.vue";
const router = useRouter();
const value = ref(new Date().getFullYear());
const options = ref([
  { name: "2024", value: "2024" },
  { name: "2023", value: "2023" },
  { name: "2022", value: "2022" },
  { name: "2021", value: "2021" },
  { name: "2020", value: "2020" },
  { name: "2019", value: "2019" },
]);
const counts = ref([
  { name: "总计租赁", value: "25" },
  { name: "当月租赁", value: "3" },
  { name: "空置数量", value: "12" },
]);
const transNumber = (data) => {
  if (!data || typeof Number(data) !== "number") return data;
  return Number(data).toLocaleString();
};
const total = 1300;
const data = [
  { label: "入住率", value: 60, total: transNumber(60) },
  {
    label: "园区可收租金",
    value: (total / total) * 100,
    num: transNumber(total),
    format: (percentage) => {
      return `${(percentage / 100) * total}万元`;
    },
  },
  {
    label: "已租可收租金",
    value: (968 / total) * 100,
    num: transNumber(968),
    format: (percentage) => {
      return `968万元`;
    },
  },
  {
    label: "当前已收租金",
    value: (695 / total) * 100,
    num: transNumber(695),
    format: (percentage) => {
      return `695万元`;
    },
  },
  { label: "收益率", value: 73.5, total: transNumber(73.5) },
];
const togo = () => {
  router.push("/detailed");
};
</script>
<style scoped lang="scss">
::v-deep {
  .el-select__placeholder {
    color: #65b8f8;
  }
  .el-select__wrapper {
    background: transparent !important;
    border: 1px solid #538aaf !important;
    box-shadow: inset 0px 0px 8px 1px rgba(26, 116, 200, 0.5) !important;
  }
}
.content {
  font-size: 16px;
  padding: 16px;

  &-imgs {
    width: 100%;
    margin: 10px auto;
    text-align: center;

    > img {
      width: 192px;
      height: 144px;
      margin-right: 16px;
    }
  }
  &-count {
    display: flex;
    text-align: center;
    margin-top: 10px;
    &-item {
      flex: 1;
    }
    &-value {
      margin-top: 10px;
      font-size: 14px;
      > span {
        color: #65b8f8;
        font-size: 32px;
        font-weight: bold;
      }
    }
  }
  &-progress {
    margin-top: 10px;
  }
}
</style>
